<?php session_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Detalles de excursi&oacute;n</title>
	<script type="text/javascript" src="funciones.js"></script>
	<link href="../default.css" rel="stylesheet" type="text/css" />

</head>

<body>

<table>	
	<tr>
			<td></td>
			<td colspan="3">
				<span id="error_message" style="visibility:hidden">Debe llenar todos los campos correctamente</span>
			</td>
			<td></td>
			<td></td>
	</tr>
</table>

<?php

$eid=$_GET['eid'];

$connection=mysql_connect("localhost","root","root",false,196608);
mysql_select_db("piaimu",$connection);
$tipousr=mysql_query("",$connection);

$query=mysql_query("SELECT e.id_excursion, e.dia_exc, e.mes_exc, e.ano_exc, e.nombre_exc, l.nombre_loc, s.nombre_est FROM excursion AS e JOIN localidad AS l ON e.id_localidad=l.id_localidad JOIN estado AS s ON l.id_estado=s.id_estado WHERE id_excursion=$eid AND e.act_exc='1';",$connection);

$rows=mysql_num_rows($query);

echo "<table>";
	echo "<tr>";
		echo "<td align='right'><span>Nombre:</span></td>";
		echo "<td><span>" . mysql_result($query,$i,4) . "</span></td>";
	echo "</tr>";

	echo "<tr>";
		echo "<td align='right'><span>Fecha:</span></td>";
		echo "<td><span>" . mysql_result($query,$i,1) . "/" . mysql_result($query,$i,2) . "/" . mysql_result($query,$i,3) . "</span></td>";
	echo "</tr>";

	echo "<tr>";
		echo "<td align='right'><span>Estado:</span></td>";
		echo "<td><span>" . mysql_result($query,$i,6) . "</span></td>";
	echo "</tr>";

	echo "<tr>";
		echo "<td align='right'><span>Localidad:</span></td>";
		echo "<td><span>" . mysql_result($query,$i,5) . "</span></td>";
	echo "</tr>";

	echo "<tr>";
		echo "<td align='right'><span>Album:</span></td>";
		echo "<td><a href='fotos/?eid=" . $eid . "'><span>Ver</span></a></td>";
	echo "</tr>";

echo "</table>";

	if ($_SESSION['tipousuario']==1)
	{
		echo "<input id='btn_cargarFoto' type='button' onclick='cargarFoto()' value='Cargar foto' />";
	
		echo "<form id='form_cargarFoto' name='form_cargarFoto' style='visibility:hidden' action='cargarfoto.php?eid=" . $eid . "' method='post' enctype='multipart/form-data' />";
		echo "<input type='file' name='foto' id='foto' onchange='canUpload()' />";
		echo "<br />";
		echo "<input type='submit' id='sub_cargar' value='Cargar' disabled='true' />";
		echo "<input id='btn_cancelarCargaFoto' type='button' onclick='cancelarCargarFoto()' value='Cancelar' />";
		echo "</form>";
	}

?>

</body>
</html>
